<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8"/>
    <title>Customer</title>
    <link rel='stylesheet' href='http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css'>
</head>
<body class="container">
<br/>

<br/>
<div class="with:80%">
    <table class="table table-hover">
        <thead>
        <tr>
            <th>#</th>
            <th>名称</th>
            <th>性别</th>
            <th>身高</th>
            <th>修改</th>
            <th>删除</th>
        </tr>
        </thead>
        <tbody>
        <tr  th:each="heroes : ${heroes}">
            <th scope="row" th:text="${heroes.id}">1</th>
            <td th:text="${heroes.name}">neo</td>
            <td th:text="${heroes.sex}">Otto</td>
            <td th:text="${heroes.height}">Otto</td>

            <td><a th:href="@{/hero/toEdit(id=${heroes.id})}">edit</a></td>
            <td><a th:href="@{/hero/delete(id=${heroes.id})}">delete</a></td>
            <!--<td><a onclick="member_del(this,'id=${customers.customerId}')"  href="javascript:;">delete</a></td>-->
        </tr>
        </tbody>
    </table>
</div>
<div class="form-group">
    <div class="col-sm-2 control-label">
        <a href="/hero/toAdd" th:href="@{/hero/toAdd}" class="btn btn-info">add</a>
    </div>
</div>

<!--<script>

    /*删除*/
    function member_del(obj,customerId){
        layer.confirm('确认要删除吗？',function(index){
            //发异步删除数据
            $.get("th:href=@{/customer/delete}",{"customerId":customerId},function (data) {
                if(data =true){
                    layer.msg('删除成功!',{icon:1,time:2000});
                    setTimeout(function () {window.location.href='${pageContext.request.contextPath}/customer/selectList';},2000);

                }else {
                    layer.msg('删除失败!',{icon:1,time:3000});
                    setTimeout(function () {window.location.href='${pageContext.request.contextPath}/findOpportunities';},2000);
                }
            });
        });
    }

</script>-->

</body>
</html>